import Vue from "vue";

// 路由相关
import VueRouter from "vue-router";
import router from "@/router";

// 第三方库
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import "@/dist/style.css";

import App from "./App.vue"; // 入口文件
import "@/styles/index.scss";
import directives from "@/directive/index.js";

Vue.use(ElementUI);
Vue.use(VueRouter);

// 注入全局指令
Object.keys(directives).forEach((key) => {
  Vue.directive(key, directives[key]);
});

Vue.prototype.$message = (options) => {
  ElementUI.Message({ ...options, duration: 1500 });
};

new Vue({
  el: "#app",
  router,
  render: (h) => h(App)
});
